﻿using BCCommon;
using BCCommon.Enums;
using BCCommon.FreightEnums;
using BCCommon.PaymentEnums;
using BCDto.Common.Payment.Payment;
using BCDto.Common.Payment.PaymentRecord;
using BCDto.Sim.Admin.Admin;
using BCEntity.Common.Payment.Payment;
using System;
using System.Collections.Generic;

namespace BCService.Common.Payment.PaymentRecord
{
    /// <summary>
    /// 支付记录服务接口
    /// </summary>
    public interface ICommonPaymentRecordService
    {
        /// <summary>
        /// 获取支付记录信息
        /// </summary>
        /// <param name="paymentRecordId">支付记录Id</param>
        /// <returns></returns>
        PaymentRecordDto GetPaymentRecord(long paymentRecordId);
        /// <summary>
        /// 修改支付记录验签时间
        /// </summary>
        /// <param name="paymentRecordId">支付记录Id</param>
        /// <returns></returns>
        bool UpodatePaymentRecordCheckSignTime(long paymentRecordId);


        /// <summary>
        /// 获取支付记录列表
        /// </summary>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页大小</param>    
        /// <param name="userId">用户ID</param>
        /// <returns></returns>
        PageableList<PaymentRecordDto> GetPaymentRecordsByUserId(int pageIndex, int pageSize, long userId);

        /// <summary>
        /// 获取支付记录列表
        /// </summary>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页大小</param>    
        /// <param name="agentRecordId">用户ID</param>
        /// <returns></returns>
        PageableList<PaymentRecordDto> GetPaymentRecordsByAgentRecordId(int pageIndex, int pageSize, long agentRecordId);
        /// <summary>
        /// 修改支付记录状态为成功
        /// </summary>
        /// <param name="paymentRecordId">支付记录Id</param>
        PaymentRecordDto UpdatePaymentRecordStatusSuccess(long paymentRecordId);
        /// <summary>
        /// 获取支付成功记录信息
        /// </summary>
        /// <param name="userName">客户姓名</param>
        /// <param name="phone">手机号</param>
        /// <param name="appType">App类型</param>
        /// <param name="orderType">订单类型</param>
        /// <param name="payChannelType">支付渠道</param>
        /// <param name="start">支付开始时间</param>
        /// <param name="end">支付结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <param name="paymentStatus"></param>
        /// <returns></returns>
        PageableList<PaymentRecordUserViewDto> Query(string userName, string phone, SourceAppType? appType, FlowType? orderType, PaymentChannelType? payChannelType, DateTime? start, DateTime? end, int? pageIndex, int? pageSize, PaymentResultType? paymentStatus = PaymentResultType.Success);
        /// <summary>
        /// 获取对账单详情
        /// </summary>
        /// <param name="vehicleServiceNotificationOrderCode">车辆服务通知单编码</param>
        /// <returns></returns>
        PaymentRecordBillViewDto GetBillDetails(string vehicleServiceNotificationOrderCode);
        /// <summary>
        /// 发起原路退回
        /// </summary>
        /// <param name="adminDto">管理员信息</param>
        /// <param name="refundRequestDto">退款请求</param>
        /// <returns></returns>
        decimal Refund(AdminDto adminDto,RefundRequestDto refundRequestDto);
        /// <summary>
        /// 写入退款记录
        /// </summary>
        /// <param name="paymentRecordDto">网银支付记录流水</param>
        /// <returns></returns>
        bool InsertRefundRecord(PaymentRecordDto paymentRecordDto);
        /// <summary>
        /// 引用编号
        /// </summary>
        /// <param name="referenceNumber">引用编号</param>
        /// <returns></returns>
        PaymentRecordDto GetRefundPaymentRecord(string referenceNumber);
        /// <summary>
        /// 获取支付记录列表
        /// </summary>
        /// <param name="referenceNumber">引用编号</param>
        /// <returns></returns>
        IEnumerable<PaymentRecordDto> GetEntityByReferenceNumberAsync(string referenceNumber);
    }
}
